/ README.txt
/
/ Copyright (c) 2008, Oracle. All Rights Reserved.

Description:
This demo converts LAS 1.1 documents into pointclouds stored in base table. 
The LASOracleLoader.java first forms a table called lidar_data, which
is next processed by lastopc.sql to produce the desired base table
which has the pointclouds in the first column and other LAS file
properties in its next columns.

Instructions:
0. This process assumes that
    a). You have Oracle Spatial Option installed on your database.
    b). You have the necessary Java libraries
       in your classpath:
            ojdbc5.jar      - Oracle JDBC

1. Compile the java program on command line as follows:
     javac -cp $CLASSPATH LASOracleLoader.java \
                          GeoRefInfo.java \
                          LAS.java \
                          LASHeader.java \
                          LASPointDataRecord.java \
                          LASPointDataRecordFormat0.java  \
                          LASPointDataRecordFormat1.java \
                          LASVariableLengthRecord.java

2. start.sh (unix): This shell script has the required command to run the 
   compiled LASOracleLoader program. Note that you may want to edit the 
   program arguments in PROG_ARGS line in start.sh. We have some default 
   values in the program parameters in PROG_ARGS line in start.sh.
   The PROG_ARGS line must be in one single line and it is expanded
   here for convenient reading as follows:
   
   PROG_ARGS="-computerName stacs34.us.oracle.com 
              -portNumber 43265 
              -databaseNamei hello1 
              -driver thin 
              -schemaName scott 
              -password tiger 
              -lasfilenames $ORACLE_HOME/md/demo/PointCloud/examples/LAS/LASFileNames.txt"

   To see the different options for changing the default parameters,
   you can run start.sh by commenting the first PROG_ARGS line in start.sh
   and uncommenting the second PROG_ARGS in start.sh file. 
   
   Make sure start.sh is executable file by setting its file permissions 
   such as -rwxrwxrwx (chmod 777).
   
   The lasfilenames parameter is the absolute address (on your linux/unix system)
   of the txt file which contains the absolute addresses of LAS files on each 
   line. The default input LAS files are Naches_BareEarth_Block1.las and 
   Yakutat_Alaska_BareEath_LiDAR_UTM_Zone7N_NAD83.las
   which are listed in the LASFileNames.txt.
   
   After setting parameters for your system, run the LASOracleLoader java program 
   as:
   ./start.sh (unix) 
   
   You will have a table called lidar_data after running start.sh.

3. Connect to a database schema (say scott/tiger), run lastopc.sql
   to have the base table which is the desired result whose
   first column in a row is the pointcloud corresponding to all 
   of the points of a LAS file. These points are initially stored 
   in the point_data_records table before running lastopc.sql. 
   Previously, we used to have point_data_records column (a nested table)
   in lidar_data table, which had performance issue. The point_data_records
   has as many rows as the total number of points for the whole
   set of LAS files. For instance, Naches_BareEarth_Block1.las file
   has 8382956 number of points and  
   Yakutat_Alaska_BareEath_LiDAR_UTM_Zone7N_NAD83.las file has
   7997091 number of points. Therefore, point_data_records has now
   16380047 number of points. Each LAS file's points are distinguished
   by the new recordID column in point_data_records table. 

   The base (final, permanent) table has as many rows as LAS
   files listed in LASFileNames.txt. In other words, each row of 
   base table corresponds to each LAS file.
   Accompanied with base table are the blktab# and res# tables which
   are supporting tables to hold pointcloud blocks. Please donot
   delete these blktab# and res# tables if you wanna keep base table. 

Output:
The base table with first column as pointcloud and other columns
as properties of a LAS file. The blktab# and res# tables holding
blocks of pointcloud. There should be a single base table and 
blktab# and res# tables as many as LAS files.
